// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the GNU Affero General Public License v3.0.
// See the LICENCE file in the repository root for full licence text.

.user-card-brick {
  @_border-width: 2px;
  @_brick-padding-horizontal: 8px;
  @_fade-duration: 220ms;
  @_group-bar-margin: 5px;
  @_top: user-card-brick;

  --border-colour: transparent;

  width: min-content;
  max-width: 100%;
  background-color: hsla(var(--hsl-b2), 0.8);
  box-shadow: inset 0 0 0 @_border-width var(--border-colour);
  border-radius: @border-radius-large;
  display: flex;
  align-items: center;
  padding: 1px 3px;

  &--friend {
    --border-colour: hsl(var(--hsl-green-2));
  }

  &--mutual {
    --border-colour: hsl(var(--hsl-pink-2));
  }

  &__group-bar {
    background-color: var(--group-colour, @group-colour-default);
    width: 4px;
    height: 1em;
    border-radius: 10000px;
    margin: 0 @_group-bar-margin;
  }

  &__link {
    .link-white();
    .link-plain();

    display: flex;
    padding: @_border-width @_brick-padding-horizontal @_border-width
      @_brick-padding-horizontal - @_group-bar-margin;
    height: 100%;
    align-items: center;
    overflow: hidden;
  }

  &__remove {
    .reset-input();

    opacity: 0.7;
    padding: 0 0.3em;
    margin: @_border-width;
    margin-left: 0; // remove unclickable gap between button and link

    border-radius: 50%;
    display: flex;
    aspect-ratio: 1;
    place-items: center;

    .link-hover({
      opacity: 1;
      background-color: hsl(var(--hsl-b1));
    });
  }

  &__username {
    font-weight: bold;
    padding-bottom: 1px; // adjust alignment
  }
}
